package com.xht.controller;

import com.xht.domain.ResponseResult;
import com.xht.service.impl.VideoServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/railway")
public class VideoController {

    @Autowired
    private VideoServiceImpl videoService;

    /**
     * 视频列表显示
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/videoList")
    public ResponseResult videoList(Integer pageNum, Integer pageSize) {
        return videoService.videoList(pageNum, pageSize);
    }

    /**
     * 获取视频详情
     */
    @GetMapping("/video/{id}")
    public ResponseResult getVideoDetail(@PathVariable Integer id) {

        return videoService.getVideoDetail(id);
    }
}
